<?php
class ORMpz_transfer extends ORMBase {
  public function __construct() {
    parent::__construct('pz_transfer');
  }

  public function __toEpObject($myManager, $epObject, $object) {
    $epObject->trackId = isset($object->trackId) ? $object->trackId : '';
    $epObject->createdDate = (isset($object->createdDate) && $object->createdDate) ? SimpleDate::toStamp($object->createdDate) : 0;
    $epObject->transferDate = (isset($object->transferDate) && $object->transferDate) ? SimpleDate::toStamp($object->transferDate) : 0;
    $epObject->transferto = isset($object->transferto) ? $object->transferto : '';
    $epObject->transferto_trackId = isset($object->transferto_trackId) ? $object->transferto_trackId : '';
    $epObject->transferfrom = isset($object->transferfrom) ? $object->transferfrom : '';
    $epObject->transferfrom_trackId = isset($object->transferfrom_trackId) ? $object->transferfrom_trackId : '';
    $epObject->amount = isset($object->amount) ? $object->amount : 0;
    $epObject->method = isset($object->method) ? $object->method : '';
    $epObject->note = isset($object->note) ? $object->note : '';
    $epObject->status = isset($object->status) ? $object->status : 0;
    $epObject->cancelledDate = (isset($object->cancelledDate) && $object->cancelledDate) ? SimpleDate::toStamp($object->cancelledDate) : 0;
    $epObject->cancelledOperator = isset($object->cancelledOperator) ? $object->cancelledOperator : '';
    $epObject->cancelledMessage = isset($object->cancelledMessage) ? $object->cancelledMessage : '';
    return $epObject;
  }

  public function __toObject($myManager, $epObject, $object) {
    $object->id = $epObject->oid;
    $object->trackId = $epObject->trackId;
    $object->createdDate = ($epObject->createdDate != 0) ? SimpleDate::fromStamp($epObject->createdDate) : 0;
    $object->transferDate = ($epObject->transferDate != 0) ? SimpleDate::fromStamp($epObject->transferDate) : 0;
    $object->transferto = $epObject->transferto;
    $object->transferto_trackId = $epObject->transferto_trackId;
    $object->transferfrom = $epObject->transferfrom;
    $object->transferfrom_trackId = $epObject->transferfrom_trackId;
    $object->amount = $epObject->amount;
    $object->method = $epObject->method;
    $object->note = $epObject->note;
    $object->status = $epObject->status;
    $object->cancelledDate = ($epObject->cancelledDate != 0) ? SimpleDate::fromStamp($epObject->cancelledDate) : 0;
    $object->cancelledOperator = $epObject->cancelledOperator;
    $object->cancelledMessage = $epObject->cancelledMessage;
    return $object;
  }
}
?>
